import request from '@/utils/request'

/**
 * 首页图片列表
 * @param params  可包含 createBy, createTime, id, imageUrl, type, updateBy, updateTime, page, limit
 */
export function listHomepageImage(params) {
  return request({
    url: '/admin/homepage/image/list',
    method: 'GET',
    params: params
  })
}

/**
 * 新增首页图片配置
 * @param data HomepageImage 对象
 */
export function insertHomepageImage(data) {
  return request({
    url: '/admin/homepage/image/insert',
    method: 'POST',
    data: data
  })
}

/**
 * 更新首页图片配置
 * @param data 包含 id 的 HomepageImage 对象
 */
export function updateHomepageImage(data) {
  return request({
    url: '/admin/homepage/image/update',
    method: 'POST',
    data: data
  })
}

/**
 * 删除首页图片配置
 * @param id 配置ID
 */
export function deleteHomepageImage(id) {
  return request({
    url: '/admin/homepage/image/delete',
    method: 'GET',
    params: { id }
  })
}
